package com.food.controller;


import com.food.configure.Result;
import com.food.entity.PurchaseLog;
import com.food.service.PurchaseLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author
 * @since 2021-04-04
 */
@RestController
@RequestMapping("/purchaseLog")
public class PurchaseLogController {

    @Autowired
    PurchaseLogService purchaseLogService;

    /**
     * 添加/修改--采购日志
     */
    @RequestMapping("/updatePurchaseLog")
    public Result<PurchaseLog> updatePurchaseLog(@RequestBody PurchaseLog purchaseLog) {
        return purchaseLogService.updatePurchaseLog(purchaseLog);
    }

    /**
     * 删除
     */
    @RequestMapping("/delPurchaseLog")
    public Result<PurchaseLog> delPurchaseLog(@RequestBody PurchaseLog purchaseLog) {
        return purchaseLogService.delPurchaseLog(purchaseLog);
    }

    /**
     * 批量删除
     */
    @RequestMapping("/batchDelPurchaseLog")
    public Result<PurchaseLog> batchDelPurchaseLog(@RequestBody PurchaseLog purchaseLog) {
        return purchaseLogService.batchDelPurchaseLog(purchaseLog);
    }

    /**
     * 查询(不分页)
     */
    @RequestMapping("/queryPurchaseLog")
    public Result<PurchaseLog> queryPurchaseLog(@RequestBody PurchaseLog purchaseLog) {
        return purchaseLogService.queryPurchaseLog(purchaseLog);
    }

    /**
     * 查询(分页)--采购日志页
     */
    @RequestMapping("/queryPurchaseLogByPage")
    public Result<PurchaseLog> queryPurchaseLogByPage(@RequestBody PurchaseLog purchaseLog) {
        return purchaseLogService.queryPurchaseLogByPage(purchaseLog);
    }

    /**
     * 根据ID查询
     */
    @RequestMapping("/queryPurchaseLogById")
    public Result<PurchaseLog> queryPurchaseLogById(@RequestBody PurchaseLog purchaseLog) {
        return purchaseLogService.queryPurchaseLogById(purchaseLog);
    }

    /**
     * 录入采购--修改采购状态
     */
    @RequestMapping("/updateStatus")
    public Result<PurchaseLog> updateStatus(@RequestBody PurchaseLog purchaseLog) {
        return purchaseLogService.updateStatus(purchaseLog);
    }



}

